package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpYAccountUserProfileDefaultsTabPageUtil extends SeleniumPageUtil {

	public final static By UPDT_SPAN_HEADER_DEFAULTS = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_hdrDefaults_lblHeader");
	public final static By UPDT_TD_LANGUAGE = By.xpath("//*[@id='ctl44_ParentChildContainer_PnlChildControl']/table[2]/tbody/tr[1]/td[1]");
	public final static By UPDT_SELECT_LANGUAGE = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_cboLanguage");
	public final static By UPDT_TD_LANDING_SPOT = By.xpath("//*[@id='ctl44_ParentChildContainer_PnlChildControl']/table[2]/tbody/tr[2]/td[1]");
	public final static By UPDT_INPUT_ACTIVITY_BOARD = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_rdoActivity");
	public final static By UPDT_LABEL_ACTIVITY_BOARD = By.xpath("//*[@id='ctl44_ParentChildContainer_PnlChildControl']/table[2]/tbody/tr[2]/td[2]/label");
	public final static By UPDT_INPUT_SMS_DASHBOARD = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_rdoSMSDashboard");
	public final static By UPDT_LABEL_SMS_DASHBOARD = By.xpath("//*[@id='dvSMSDashboard']/label");
	public final static By UPDT_TD_TAB = By.xpath("//*[@id='trDefaultTab']/td[1]");
	public final static By UPDT_SELECT_TAB = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_cboDefaultTab");
	public final static By UPDT_TD_REPORT_PAGE_SIZE = By.xpath("//*[@id='ctl44_ParentChildContainer_PnlChildControl']/table[2]/tbody/tr[5]/td[1]");
	public final static By UPDT_INPUT_REPORT_PAGE_SIZE = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_txtReportRows");
	
	public final static By UPDT_HEADER_WAREHOUSE_ASSIGNMENTS = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_WarehouseReport_Header_lblHeader");
	public final static By UPDT_IMG_PREFERENCES = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_WarehouseReport_Header_imgPreferences");
	public final static By UPDT_IMG_EXPORT_TO_EXCEL = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_WarehouseReport_Header_imgExcelExport");
	public final static By UPDT_LBL_PAGE = By.xpath("//*[@id='ctl44_ParentChildContainer_PnlChildControl']/table[4]/tbody/tr/td[1]");
	public final static By UPDT_LBL_PAGE_NO = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_WarehouseReport_PagingTop_lblPagingPageNumber");
	public final static By UPDT_LBL_PAGE_OF = By.xpath("//*[@id='ctl44_ParentChildContainer_PnlChildControl']/table[4]/tbody/tr/td[3]");
	public final static By UPDT_LBL_PAGE_COUNT = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_WarehouseReport_PagingTop_lblPagingPageCount");
	public final static By UPDT_IMG_FIRST = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_WarehouseReport_PagingTop_imgFirst");
	public final static By UPDT_IMG_PREVIOUS = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_WarehouseReport_PagingTop_imgPrevious");
	public final static By UPDT_IMG_NEXT = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_WarehouseReport_PagingTop_imgNext");
	public final static By UPDT_IMG_LAST = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_WarehouseReport_PagingTop_imgLast");
	public final static By UPDT_IMG_FILTER_0 = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_WarehouseReport_filter_0\r\n            ");
	public final static By UPDT_IMG_FILTER_1 = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_WarehouseReport_filter_1\r\n            ");
	public final static By UPDT_TH_WAREHOUSE_ID = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_WarehouseReport_sort_0\r\n          ");
	public final static By UPDT_TH_WAREHOUSE_DESCRIPTION = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_WarehouseReport_sort_1\r\n          ");
	public final static By UPDT_TH_ASSIGNED = By.id("ctl44_ParentChildContainer_UserProfile_Defaults1_WarehouseReport_sort_2\r\n          ");
	public static void enterUserProfileDefaultsTabPage(){
		SpYAccountUserProfileDefaultPageUtil.enterYourAccountUserProfileDefaultPage();
		SeleniumUtil.click(SeleniumUtil.getCachedElement(SpYAccountUserProfileDefaultPageUtil.YAUP_TAB_DEFAULTS));
		waitForPageToLoad();
	}
	
	public static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				UPDT_SELECT_LANGUAGE, UPDT_SELECT_TAB, UPDT_IMG_PREFERENCES, UPDT_IMG_EXPORT_TO_EXCEL, UPDT_IMG_FIRST, UPDT_IMG_PREVIOUS, UPDT_IMG_NEXT,
				UPDT_IMG_LAST, UPDT_IMG_FILTER_0, UPDT_IMG_FILTER_1
			});
		
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPDT_SELECT_LANGUAGE));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPDT_SELECT_TAB));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPDT_IMG_PREFERENCES));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPDT_IMG_EXPORT_TO_EXCEL));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPDT_IMG_FIRST));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPDT_IMG_PREVIOUS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPDT_IMG_NEXT));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPDT_IMG_LAST));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPDT_IMG_FILTER_0));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPDT_IMG_FILTER_1));
	}
}
